#include "bsp.h"

#define RS_HIGH			(1)
#define RS_LOW			(0)

#define LCD_WRITE		(0)
#define LCD_READ		(1)

// Entry Mode
#define INC 				(1)
#define DEC 				(0)
#define SHIFT				(1)
#define NO_SHIFT 		(0)

// Display Control
#define DISP_ON 		(1)
#define DISP_OFF 		(0)
#define CURS_VIS 		(1)
#define CURS_INVIS 	(0)
#define BLINK				(1)
#define NO_BLINK		(0)

// Function Set
#define EIGHT_BIT		(1)
#define FOUR_BIT		(0)
#define ONE_ROW			(0)
#define TWO_ROWS		(1)
#define FIVEBY8			(0)
#define FIVEBY11		(1)

// Bit location for signals
#define LCD_RS 			(0)			//Port 2, pin 0
#define LCD_RW			(1)			//Port 2, pin 1
#define LCD_ENABLE	(2)			//Port 2, pin 2
#define LCD_BUSY		(7)			//Port 1

void delayus(int delay);
void LCDinit(void);
void LCDwriteCommand(char command, char rs);
// Clear the display and return the cursor to the home position
void LCDclear(void);
// Return the cursor to the home position
void LCDreturnHome(void);
void LCDsetEntryMode(char inc, char shift);
void LCDdispOnOff(char disp, char curs, char blink);
void LCDshift(char disp, char right);
void LCDfunctionSet(char length, char lines, char font);
void LCDsetCGaddr(char address);
void LCDsetDDaddr(char address);
void LCDwrite(int data);
void LCDwaitBusy(void);
void LCDmoveCursor(char row, char col);
void LCDprintString(char* string);
void LCDprintDecimal(uint8_t number);
